package com.erbao.dp.singleton;

import org.omg.Messaging.SyncScopeHelper;

/**
 * @author CaoBaoYin
 * @since 21/8/22 09:29
 */
public class Test {

    public static void main(String[] args) {
        /*Manager01 instance = Manager01.getInstance();
        Manager01 instance02 = Manager01.getInstance();
        System.out.println(instance == instance02);*/

        /*for (int i = 0; i < 100; i++) {
            // 构造函数传参runnable
            new Thread(()->{
                System.out.println(Manager07.getInstance().hashCode());
            }).start();
        }*/

        Class<?> aClass = null;
        try {
            aClass = Class.forName("com.erbao.dp.singleton.Manager08");
            Object newInstance = aClass.newInstance();
            System.out.println(Manager08.INSTANCE == newInstance);
        } catch (ClassNotFoundException | IllegalAccessException | InstantiationException e) {
            e.printStackTrace();
        }


    }
}
